package com.tencent.stat;

import android.content.Context;
import com.tencent.stat.common.StatLogger;
import com.tencent.stat.event.c;
import java.util.Map;

final class x
  implements Runnable
{
  public final void run()
  {
    try
    {
      if (StatServiceImpl.a(this.a))
      {
        StatServiceImpl.f().error("The event_id of StatService.trackCustomBeginEvent() can not be null or empty.");
        return;
      }
      if (StatConfig.isDebugEnable())
        StatServiceImpl.f().i("add begin key:" + this.b.toString());
      if (!(StatServiceImpl.k().containsKey(this.b)))
        break label119;
      StatServiceImpl.f().error("Duplicate CustomEvent key: " + this.b.toString() + ", trackCustomBeginEvent() repeated?");
      return;
    }
    catch (Throwable localThrowable)
    {
      StatServiceImpl.f().e(localThrowable);
      StatServiceImpl.a(this.c, localThrowable);
      return;
    }
    if (StatServiceImpl.k().size() <= StatConfig.getMaxParallelTimmingEvents())
    {
      label119: StatServiceImpl.k().put(this.b, Long.valueOf(System.currentTimeMillis()));
      return;
    }
    StatServiceImpl.f().error("The number of timedEvent exceeds the maximum value " + Integer.toString(StatConfig.getMaxParallelTimmingEvents()));
  }
}